#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include<stdlib.h>
char* mymemcpy(void* arr1, const void* arr2, size_t count)
{
	char* ret = (char*)arr1;
	while (count--)
	{
		*(char*)arr1 = *(char*)arr2;
		arr1=(char*)arr1+1;
		arr2=(char*)arr2+1;
	}
	return ret;
}
char* mymemove(void* arr1, const void* arr2, size_t count)
{
	char* ret = (char*)arr1;
	if (arr1 <= arr2 || arr1>=(char*)arr2+count)
	{
		while (count--)
		{
			*(char*)arr1 = *(char*)arr2;
			arr1 = (char*)arr1 + 1;
			arr2 = (char*)arr2 + 1;
		}
	}
	else
	{
		while (count--)
		{
			*((char*)arr1 + count) = *((char*)arr2 + count);
		}
	}
	return ret;
}
int main()
{
	int arr1[] = { 1,8,9,1,6,5,9 };
	int arr2[] = { 1,2,3 };
	mymemove(arr1, arr1+3, 12);
	return 0;
}